package com.gcxy.jk.shixunyi.controller;

import com.gcxy.jk.shixunyi.entity.Order;
import com.gcxy.jk.shixunyi.entity.Payment;
import com.gcxy.jk.shixunyi.service.PaymentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @version 1.0
 * @Author xujianlun
 * @Date 2022/10/1 21:02
 * @注释
 */
@RequestMapping("/payment")
@RestController
@Api(tags = "支付接口")
public class PaymentController {
    @Autowired
    private PaymentService paymentService;
    @ApiOperation(notes = "支付信息", value = "支付信息")
    @PostMapping(value = "/createPayment/{orderId}&{openid}")
    public String createPayment(@PathVariable("orderId") Long orderId, @PathVariable("openid")String openid){
        return paymentService.createPayment(orderId,openid);
    }
    @ApiOperation(notes = "所有信息", value = "所有信息")
    @GetMapping(value = "/findAllPayment")
    public List<Payment> findAll(){
        return paymentService.findAll();
    }

}
